package com.waya.string;

public class StringDemo4 {
    public static void main(String[] args) {
        int[] arrays = {1,2,3};
        String str = printToArrays(arrays);
        System.out.println(str);
    }
    public static String printToArrays(int[] arrays){
        String str = "[";
        for (int i = 0; i<arrays.length; i++) {

            if(i == arrays.length - 1 ){
                str += "word" + arrays[i] + "]";
            }else{
                str += "word" + arrays[i] + "#";
            }


        }
        return str;
    }
}
